<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
 <%@taglib uri="/struts-tags" prefix="s"%>
 <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>OA协同办公系统</title>
<link type="text/css" rel="stylesheet" href="css/table.css">
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="js/openwindow.js"></script>
<script type="text/javascript" src="js/file.js"></script>
<SCRIPT type="text/javascript" src="js/workflow.js"></SCRIPT>
<script src="js/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
		<style type="text/css">
		body,td,th {
			background-color:white;
			font-family: "宋体";
			font-size: 12px;
		}
		</style>
<script type="text/javascript">

function printDoc(){
			window.print();
		}
$(function(){
		var area=$("textarea");
	for(var i=0;i<area.length;i++){
		$("#"+area[i].id).attr("style","width:550px; height:100px; border:0px; overflow-y:auto;");
	}
	var  list=$("#formContent").find("input");
	for(var i=0;i<list.length;i++){
	if(list[i].id=='word'){
		$("#word").removeAttr("disabled");
	}else{
		list[i].disabled=true;
		}
}
	formContent();
});
	
	function draftWord(val) {
		var id=$("#"+val).val();
		var url = "wordEditor.action?wordId="+id+"&proportyName="+val+"&status=-1,1,0,0,0,0,0";
		openWindow(url, 700, 700);
	}
	

function formContent(){
	var tableId=$("#tableId").val();
	var formId=$("#formId").val();
	var param={"tableId":tableId,"formId":formId};
	$.post("getFormContent.action",param,function(data){
		var jsondata=data.jsonData;
		var jsonObj=eval(jsondata);
		var proportyList=data.proportyList;
		for(var i=0;i<proportyList.length;i++){
			if(proportyList[i].columnName==jsonObj[i+1].name){
				$("#"+proportyList[i].columnName).val(jsonObj[i+1].value);
			}
			if(proportyList[i].type=='upload'){
				downloadFile(proportyList[i].columnName);				
			}
		}

	},"json");
}

</script>
  </head>
  
<body>
<form action="" method="post" name="documentForm" >
<input id="tableId" type="hidden" value="${tableId}">
<input id="flowId" type="hidden" value="${workflow.id}">
<input id="formId" type="hidden" value="${definition.formId}">
<input id="instanceId" type="hidden" value="${instanceId}">
<div id="nodebutton" style="margin-left: 30px;margin-top: 10px">
		<input type="button" class="button_04"  value="流程查看" onclick="flowLook('${instanceId}');" />
		<input type="button" class="button_04"  value="打印" onclick="printDoc();" />
	</div>
	<div id="formContent">
	${definition.content}
	</div>
</form>
</body>
</html>
